/***************************************
* Jerato Ver 0.1
* Copyright 2008 Beta.Ito
* MIT License
***************************************/
package com.googlecode.jerato.library;

public class SystemSettings extends Settings{
	protected static final long serialVersionUID = SystemSettings.class.hashCode();

	protected static final Settings _settings = new SystemSettings();
	protected static final String SETTINGS_NAME = "com.googlecode.jerato.library.JeratoSettings";

	static{
		_settings.load();
		Settings userSettings = new Settings(SETTINGS_NAME, ValueUtility.getPathFromClass(SETTINGS_NAME) + ".user.xml");
		userSettings.setIgnoreNotFound(true);
		userSettings.load();
		_settings.putAll(userSettings);
	}

	private SystemSettings(){
		super(SETTINGS_NAME);
	}

	public static Settings getInstance(){
		return _settings;
	}
	public static void main(String[] args) {
		String databaseDriver = SystemSettings.getInstance().getString("DatabaseDriver");
		System.out.println("databaseDriver=" + databaseDriver);
	}
	
	public static String getSystemString(String name){
		return _settings.getString(name);
	}
}
